/* stylelint-disable scss/dollar-variable-pattern */
@use "sass:color";
@use "sass:list";
@use "sass:map";
@use "sass:meta";
@use "@sass-palette/helper";
@use "@sass-palette/hope-config";

$_primary_theme_color: hope-config.$theme-color;

@if meta.type-of(hope-config.$theme-color) == list {
  $_primary_theme_color: list.nth(hope-config.$theme-color, 1);
}

$_theme_color_light: helper.get-color($_primary_theme_color);
$_theme_color_dark: helper.get-dark-color($_primary_theme_color);

// accent color
$vp-c-accent: (
  light: color.change($_theme_color_light, $lightness: 35%, $alpha: 1),
  dark: color.change($_theme_color_dark, $lightness: 55%, $alpha: 1),
) !default;
$vp-c-accent-bg: (
  light: color.change($_theme_color_light, $lightness: 45%, $alpha: 1),
  dark: color.change($_theme_color_dark, $lightness: 47.5%, $alpha: 1),
) !default;
$vp-c-accent-hover: (
  light: color.change($_theme_color_light, $lightness: 50%, $alpha: 1),
  dark: color.change($_theme_color_dark, $lightness: 45%, $alpha: 1),
) !default;
$vp-c-accent-soft: (
  light: color.change(
      $_theme_color_light,
      $lightness: 40%,
      $saturation: 80%,
      $alpha: 0.14
    ),
  dark: color.change(
      $_theme_color_dark,
      $lightness: 40%,
      $saturation: 80%,
      $alpha: 0.16
    ),
) !default;
$vp-c-accent-text: var(--vp-c-white) !default;

// background
$vp-c-bg-soft: (
  light: color.change(helper.get-color($vp-c-bg), $alpha: 0.9),
  dark: color.change(helper.get-dark-color($vp-c-bg), $alpha: 0.9),
) !default;
$vp-c-bg-elv-soft: (
  light: color.change(helper.get-color($vp-c-bg-elv), $alpha: 0.9),
  dark: color.change(helper.get-dark-color($vp-c-bg-elv), $alpha: 0.9),
) !default;

// getting palette values
$_text_color_light: helper.get-color($vp-c-text);
$_text_color_dark: helper.get-dark-color($vp-c-text);

// text
$vp-c-text-mute: (
  light: color.scale($_text_color_light, $alpha: -22%),
  dark: color.scale($_text_color_dark, $alpha: -30%),
) !default;
$vp-c-text-subtle: (
  light: color.scale($_text_color_light, $alpha: -44%),
  dark: color.scale($_text_color_dark, $alpha: -56%),
) !default;

// border
$vp-c-border-hard: (
  light: color.scale(helper.get-color($vp-c-border), $lightness: -5%),
  dark: color.scale(helper.get-dark-color($vp-c-border), $lightness: 5%),
) !default;
